home *** CD-ROM | disk | FTP | other *** search
- function loadImage(mc, node, extrapath)
- {
- var _loc3_ = extrapath;
- if(_loc3_ == null)
- {
- _loc3_ = "";
- }
- var strDefaultPath = Tardis.ASSETS_FOLDER + "images/" + Tardis.ActiveSection.id + "/";
- var _loc1_ = node.firstChild.nodeValue;
- var _loc2_ = node.attributes.path;
- if(_loc2_ != null)
- {
- _loc1_ = _loc2_ + _loc1_;
- }
- else
- {
- _loc1_ = strDefaultPath + _loc3_ + _loc1_;
- }
- if(strPathPrefix == null)
- {
- strPathPrefix = "";
- }
- mc.loadMovie(strPathPrefix + _loc1_);
- }
- function addLink(mc)
- {
- Links[mc.link] = mc;
- }
- function getMCfromLink(Item)
- {
- var _loc1_ = Item;
- if(Links[_loc1_] == null)
- {
- var _loc2_ = [];
- while(_loc1_ != sideMenu.ItemHome)
- {
- _loc2_.unshift(_loc1_._name.split("_").pop());
- _loc1_ = _loc1_._parent._parent;
- }
- var _loc3_ = _loc2_.join("/");
- Links[_loc1_] = Links[_loc3_];
- }
- return Links[_loc1_];
- }
- function removeLinkListener()
- {
- Tardis.sideMenu.EB.removeListener(this);
- }
- function txtOver(mc)
- {
- var _loc1_ = mc;
- _loc1_.gotoAndStop("over");
- temp.text = "num = " + _loc1_.num;
- _parent.preview.doOver(_loc1_.num);
- Tardis.sideMenu.doOver(_loc1_.link);
- }
- function txtOut(mc)
- {
- var _loc1_ = mc;
- _loc1_.gotoAndStop("off");
- _parent.preview.doOut(_loc1_.num);
- Tardis.sideMenu.doOut(_loc1_.link);
- }
- function txtUp(mc)
- {
- Tardis.sideMenu.doUp(mc.link);
- }
- function init()
- {
- widthArray = new Array([350,375,"portrait"],[548,243,"landscape"],[266,375,"portrait"],[350,266,"landscape"],[350,386,"landscape"]);
- layoutID = nodeData.attributes.layout;
- initx = 10;
- inity = 10;
- var _loc2_ = Tardis.ActiveSection.id;
- var _loc1_ = Tardis.Colors;
- var strColor = _loc1_.getString(_loc2_);
- SECTION_COLOR = _loc1_.getHex(_loc2_);
- DEFAULT_COLOR = _loc1_.getHex("default");
- THUMB_PATH = nodeData.attributes.thumbpath;
- bnlHasPreview = nodeData.attributes.haspreview;
- onComplete();
- bespokeInit();
- initLayout();
- }
- function setClipPositions()
- {
- var _loc1_ = Math.ceil(nodeData.childNodes.length * 0.5);
- xmargin = (widthArray[layoutID][0] - (_loc1_ - 1) * 10) / _loc1_;
- ymargin = (widthArray[layoutID][1] - (_loc1_ - 1) * 10) / _loc1_;
- }
- function initLayout()
- {
- this.createEmptyMovieClip("mc_holder",depth++);
- mc_holder._x = 0;
- mc_holder._y = 10;
- x = 0;
- setClipPositions();
- this.onEnterFrame = function()
- {
- if(x < nodeData.childNodes.length)
- {
- mc_holder.attachMovie("thumb_mc","mc_text_" + x,depth++);
- var _loc2_ = Math.ceil(nodeData.childNodes.length * 0.5);
- if(widthArray[layoutID][2] == "landscape")
- {
- if(x < _loc2_)
- {
- var xPos = x * xmargin + x * 10 + initx;
- }
- else
- {
- adjx = x - _loc2_;
- var xPos = adjx * xmargin + adjx * 10 + initx;
- }
- if(x < nodeData.childNodes.length * 0.5)
- {
- var _loc3_ = 0;
- }
- else
- {
- _loc3_ = widthArray[layoutID][1] * 0.5;
- }
- }
- else
- {
- var _loc1_ = Math.floor(x * 0.5);
- if(x % 2 == 1)
- {
- var xPos = widthArray[layoutID][0] * 0.5 + initx;
- }
- else
- {
- var xPos = 0 + initx;
- }
- _loc3_ = _loc1_ * ymargin + _loc1_ * 10;
- }
- mc_holder["mc_text_" + x]._x = xPos;
- mc_holder["mc_text_" + x]._y = _loc3_;
- x++;
- }
- else
- {
- delete this.onEnterFrame;
- }
- };
- }
- function doOver(num)
- {
- mc_holder["mc_text_" + num].gotoAndStop("over");
- }
- function doOut(num)
- {
- mc_holder["mc_text_" + num].gotoAndStop("off");
- }
- function positionElements(mc, img)
- {
- var _loc1_ = mc;
- var _loc2_ = img;
- _loc1_.titleFF._width = _loc2_._width;
- _loc1_.titleFF._y = _loc2_._height;
- _loc1_.link = _loc1_.nd.attributes.link;
- _loc1_.titleFF.htmlText = _loc1_.nd.byName("thumbtitle").getText();
- if(_loc1_._currentframe < 15)
- {
- _loc1_.titleFF.textColor = DEFAULT_COLOR;
- }
- else
- {
- _loc1_.titleFF.textColor = SECTION_COLOR;
- }
- _loc1_.activeBtn._width = _loc2_._width + 10;
- _loc1_.activeBtn._height = _loc2_._height + _loc1_.titleFF._height;
- _loc1_._visible = true;
- }
- function clipInit(clip)
- {
- num = clip._name.split("_")[2];
- clip.num = num;
- clip.nd = nodeData.childNodes[num];
- imgToCheck = eval(clip.mc_img);
- clip.intervalID = setInterval(checkLoad,500,clip,imgToCheck);
- }
- function checkLoad(mc, img)
- {
- var _loc1_ = mc;
- if(img._height > 0)
- {
- if(!_loc1_.positioned)
- {
- _loc1_.positioned = true;
- positionElements(_loc1_,img);
- clearInterval(_loc1_.intervalID);
- }
- }
- }
- Links = {};
- Tardis.sideMenu.EB.addListener(this);
- stop();
- onReady();
- this.onUnload = function()
- {
- bespokeUnload();
- removeLinkListener();
- clearInterval(intervalID);
- this.onUnload = null;
- };
-